import '@/assets/styles/element.scss'; // custom element css
import Directive from '@/directive';
import router, { setupRouter } from '@/router';
import { createApp } from 'vue';
import App from './App.vue';
import { setupPlugins } from './plugins';

async function bootstrap() {
  const app = createApp(App);

  // 注册插件：axios,elemenu-plus,tailwindcss
  setupPlugins(app);

  // 注册vue-router路由
  setupRouter(app);

  // 等待路由加载完成后再挂载根组件
  await router.isReady();

  // 注册自定义指令
  app.use(Directive);

  // 挂载根组件
  app.mount('#app');
}

bootstrap();
